package az.mecid.rssreader.utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * Created by IntelliJ IDEA.
 * User: mega
 * Date: 21.03.2010
 * Time: 14:05:47
 */
public class HashUtils {
    public static String md5(String msg){
        String hash = null;
        try {
            MessageDigest m = MessageDigest.getInstance("MD5");
            m.update(msg.getBytes());
            hash = new BigInteger(1,m.digest()).toString(16);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return hash;
    }
}
